package com.cq.hd.task.web.job;

import com.cq.hd.product.api.TbGoodsApi;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class ActiveGoodsTask {

    @Autowired
    private TbGoodsApi goodsApi;

    // 扫描已上架的商品的库存,如果低于5，发送系统通知给商户
    // 每隔1h扫描一次 0 0 */1 * * ?
    @XxlJob("scanOnGoodsStock")
    public void scanOnGoodsStock() {
        log.info("扫描已上架的商品的库存=====>开始");
        goodsApi.scanOnGoodsStock();
        log.info("扫描已上架的商品的库存=====>结束");
    }
}
